package com.iurac.dao;

import com.iurac.domain.Book;
import com.iurac.vo.BorrowVo;
import com.iurac.vo.EchartsVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface BookDao {
    List<Book> getBooksByConditionInPage(@Param("page") int page,@Param("info") String info,
                                         @Param("type") String[] type,@Param("stock") boolean stock);

    Book getBooksById(@Param("id") String id);

    List<Book> getBooksByCondition(@Param("title") String title, @Param("press") String press,
                                   @Param("author") String author, @Param("minPrice") String minPrice,
                                   @Param("maxPrice") String maxPrice, @Param("stock") boolean stock,
                                   @Param("type") String[] type);

    List<Map<String, Object>> getNumOfBookInType();

    Integer getNumOfBook();

    Integer getNumOfBorrowBookToday(@Param("today") String today);

    Integer getNumOfBorrowBook();

    Integer getNumOfBorrowBookTotal();

    int deleteBookById(@Param("id") String id);

    int getBorrowCountByBid(@Param("bid") String bid);

    int saveBook(Book book);

    int updateBook(Book book);

    List<Book> getBooksBySerialNumber(@Param("serialNumber") String serialNumber);

    int updateBookIncreaseBorrows(@Param("id") String bookId);

    int getBookCountByLocation(@Param("location") String location);

    int updateBookReduceBorrows(String id);
}
